-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding feerate to mint and burn #4318
Merged
patnir
merged 1 commit into
staging
from
rahul/ifl-1647-allow-feerate-input-to-mintasset-and-burnasset-in-our-cli
Sep 26, 2023
Merged
Adding feerate to mint and burn #4318
patnir
merged 1 commit into
staging
from
rahul/ifl-1647-allow-feerate-input-to-mintasset-and-burnasset-in-our-cli
Sep 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hughy
approved these changes
Sep 26, 2023
patnir
deleted the
rahul/ifl-1647-allow-feerate-input-to-mintasset-and-burnasset-in-our-cli
branch
September 26, 2023 19:30
patnir
added a commit
that referenced
this pull request
Oct 2, 2023
* Add creator field to transaction api calls (#4254) * Explicitly set the asset `creator` field of mints in `RawTransaction` Do not assume that a mint will be done by the same account that created the asset, but rather get the creator as an input. This is necessary to enable minting of assets that you own but you have not created. * fixes wallet.updateHead test to be independent of fixture generation (#4265) the test of updateHead fails when fixtures are regenerated, but passes if they already exist this is because creating an account may update the wallet's chainProcessor head state, but importing an account does not (https://linear.app/if-labs/issue/IFL-1585/createaccount-and-importaccount-inconsistent) fixes test to pass indpendently of fixture generation by always updating the wallet head to the genesis block before adding more blocks * When an unknown asset is seen in a wallet transaction, backfill its information from the chain db before processing the transaction This commit is purely a refactor of the current wallet logic, and should not alter the user-visible behavior of the wallet in any way. This refactor is foundational work needed to support the transfer of asset ownership (via `transferOwnershipTo`) in the future. What this commit does, in a nutshell, is that it makes the backfilling code run before the transaction gets processed: before this change: account.addPendingTransaction(...) -> backfill assets after this change: backfill assets -> account.addPendingTransaction(...) This will greatly simplify the processing of mints with `transferOwnershipTo` inside `addPendingTransaction`. * Add more information to getBlockResponse (#4217) * feat(cli,ironfish): Return native asset when streaming wallet assets (#4267) * feat(cli,ironfish): Return native asset when streaming wallet assets * test(ironfish): Fix account test * test(ironfish): Fix account test * Add a consensus parameter for asset ownership Add logic for the miners fee transactions to create the correct version mining manager only accepts transactions into blocks with the correct version for the given sequence add v2 support to RawTransaction (#4234) * add v2 support to RawTransaction * add error if transferOwnershipTo exists on a v1 transaction check the transaction version when adding blocks This no longer checks the version when transactions are broadcast. This is because there isn't an easy way to verify any particular version is correct. A transaction could become valid due to a re-org or a consensus parameter activating at a specific block sequence. set devnet activation to 1 fixtures use an optimistic transaction version when creating transactions (#4237) * use an optimistic transaction version when creating transactions This allows for transactions created around the time that a transaction version change to have an improved chance of being included in the blockchain by choosing the version if its within a range near the current head sequence instead of simply choosing the transaction version based on head sequence + 1 * clarify `versionSequenceDelta` - Now takes `number` instead of `number | undefined` for a parameter - Adds an assert to ensure a non-negative integer - Add more comments + clarify existing - Updated tests - Increased the min delta to 4, since 3 is probably too small to ensure transactions aren't dead on arrival remove hardcoded transaction version const (#4240) * remove hardcoded transaction version const * add `TransactionVersion::latest()` mempool removes transactions with versions that should no longer be valid (#4249) * Update the blockchain db whenever a mint with `transferOwnershipTo` is seen When a `MintDescription` with `transferOwnershipTo` is seen, the relevant asset on the chain db is updated to reflect the new owner. * Update the wallet db whenever a mint with `tranferOwnershipTo` is seen This also fixes a bug where minting a brand new asset and using it to send tokens to an account in the same wallet would throw an exception. * Track originating peer for block gossip (#4270) * Make activation flag nullable (#4277) * Make activation block nullable * Update unit test * Use a new type * Add (de)serialization for `Asset` * Add transferOwnershipTo support to CLI/RPC (#4278) * adding use account endpoint (#4280) * Rahul/ifl 1625 renameaccount endpoint (#4279) * adding renameAccount endpoint * rename account endpoint fixture * Rahul/ifl 1587 createaccount endpoint (#4268) * Adding create account endpoint to the wallet namespace * changing endpoint name in rpc client * moving request and response to the correct file * updating comments * adding remove account endpoint (#4281) * adding remove account endpoint * updating comment for remove * Rahul/ifl 1603 make asset response consistent across all endpoints (#4272) * new burn asset response with asset object * updating tests * moving asset to a types file to be reused in mint and burn * updating test * adding two different construct rpc methods * updating RcpAccountAssetBalanceDeltaSchema * updating get account transactions * deprecating asset variables in balance endpoints * removing asset object when id doesn't guarantee asset object is found * removing optional asset object * removing unused variable * removing construct functions * removing optional asset object * deprecating asset name fields in note, mint, and burn * normalizing rpc asset object for all endpointS * fixing tests * using asset value object * adding back GetAssetResponse * reverting client ts changes * show n/a if supply is not available * chain get asset uses same asset model * using Assert.isNotUndefined(accountAsset) * deprecating the status field on the asset * adding comment * removing expect * Resetti9ng fixture * sequential-block-time -> staging (#4276) * [BlockTime] Update block verification to only allow positive block mine time (#4113) * Update block verification * Update consensus * Update unit test * add comma * Update fixture * Set sequential block mine time to never for testnet and mainnet * Patched Fix Inefficient Regular Expression Complexity Regular Expression Denial of Service (#4271) Affected of this project are vulnerable to Regular Expression Denial of Service (ReDoS) due to the usage of an insecure regular expression within the result variable. ```js const wrap = require("word-wrap"); for (let i = 0; i <= 10; i++) { const attack = "a" + "t".repeat(i * 10_00000); const start = performance.now(); wrap( attack, { trim: true }, ); console.log(`${attack.length} characters: ${performance.now() - start}ms`); } ``` Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process. CWE-1333 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L` Co-authored-by: jowparks <[email protected]> Co-authored-by: Rohan Jadvani <[email protected]> * Rahul/ifl 1580 normalize encrypted note (#4285) * new burn asset response with asset object * updating tests * moving asset to a types file to be reused in mint and burn * updating test * adding two different construct rpc methods * updating RcpAccountAssetBalanceDeltaSchema * updating get account transactions * deprecating asset variables in balance endpoints * removing asset object when id doesn't guarantee asset object is found * removing optional asset object * removing unused variable * removing construct functions * removing optional asset object * deprecating asset name fields in note, mint, and burn * updating note response types for chain endpoints * fixing get block endpoint * combining rpc note and wallet note * Resetting gettransactionstream * removing rpc note * Resetting gettransactionstream * favoring hash over noteHash * resetting wallet types * New fixture for multiple custom transactions (#4287) * Rahul/ifl 1576 normalize block header (#4286) * new burn asset response with asset object * updating tests * moving asset to a types file to be reused in mint and burn * updating test * adding two different construct rpc methods * updating RcpAccountAssetBalanceDeltaSchema * updating get account transactions * deprecating asset variables in balance endpoints * removing asset object when id doesn't guarantee asset object is found * removing optional asset object * removing unused variable * removing construct functions * removing optional asset object * deprecating asset name fields in note, mint, and burn * updating note response types for chain endpoints * fixing get block endpoint * combining rpc note and wallet note * Resetting gettransactionstream * removing rpc note * Resetting gettransactionstream * favoring hash over noteHash * resetting wallet types * adding rpc blockheader type * setting up block header to be reused in chain * consolidating block responses with transactions * all tests pass * removing hex * changing the notesize back to null * work was on the wrong endpoint, added back to follow chain stream * removing work * removing use of BigIntUtils.writeBigU256BE * Rahul/ifl 1578 normalize transaction (#4288) * new burn asset response with asset object * updating tests * moving asset to a types file to be reused in mint and burn * updating test * adding two different construct rpc methods * updating RcpAccountAssetBalanceDeltaSchema * updating get account transactions * deprecating asset variables in balance endpoints * removing asset object when id doesn't guarantee asset object is found * removing optional asset object * removing unused variable * removing construct functions * removing optional asset object * deprecating asset name fields in note, mint, and burn * updating note response types for chain endpoints * fixing get block endpoint * combining rpc note and wallet note * Resetting gettransactionstream * removing rpc note * Resetting gettransactionstream * favoring hash over noteHash * resetting wallet types * adding rpc blockheader type * setting up block header to be reused in chain * consolidating block responses with transactions * all tests pass * removing hex * changing the notesize back to null * work was on the wrong endpoint, added back to follow chain stream * removing work * normalizing rpc account transaction * changing to wallet transaction * removing extra transaction field * renaming to account * resetting chaintypes.ts * resetting chaintypes.ts * combining notes and spends * adding comment about available notes and spends * Making confirmations a deprecated field * Use Decimal library to make feeRates deterministic (#4282) * Rahul/ifl 266 mintasset and burnasset do not accept a feerate in requests (#4289) * adding feerate to mintassets and burnassets * changing to inline if * making fee optional * Rahul/ifl 1636 normalize block (#4295) * adding block * normalizing block * removing dependency from deprecated field * making burn create mint send account field optional (#4291) * Rahul/ifl 1579 normalize transaction sub objects - mints and burns (#4293) * creating and using rpc mint and burn everywhere * compiling version * Removing deprecated comment * removing newline * moving set fields up * Rahul/ifl 1579 normalize transaction sub objects updating mint burn asset endpoints (#4294) * creating and using rpc mint and burn everywhere * compiling version * using rpc mint for mint asset endpoint * using rpc burn for burn asset endpoint * asset mint and burn test * merging staging and removing duplicate objects * updating wallet types to staging file * Add links to CI jobs on badges (#4296) * Adding the Inversed Tech audit PDF report (#4184) * resets account heads and birthdays in reset command (#4269) * Increase the default difficulty when creating genesis and devnet difficulty (#4246) * Increase the default difficulty when creating genesis This is mostly useful for local devnet testing, as the default difficulty is too easy for many systems, which results in transactions not getting picked up from the mempool when testing locally due to the pre-emptive empty block changes in the mining manager. * fixtures * Close streaming requests at the end of tests (#4090) * Rahul/ifl 1651 add ability to show usage of deprecated fields in ironfish (#4298) * adding ability to show usage of deprecated fields * turning it off to pass lint check * adding comment * updated lockfile * adding lint:deprecated * feat: rust std::backtrace (#4274) * feat: rust backtrace support for IronfishError * pr review updates * Export network definitions (#4302) * marking counts fields as deprecated (#4301) * Rahul/ifl 1641 add optional serialized field to transaction rpc (#4299) * adding optional serialized field and required signature field * adding serialized to endpoint input * using options object instead of individual optional fields * using question mark notation instead of question mark * fixing merge issue * Rahul/ifl 1665 normalize exportchainstream (#4304) * adding optional serialized field and required signature field * adding serialized to endpoint input * reusing blockheader * using options object instead of individual optional fields * using question mark notation instead of question mark * fixing merge issue * creating single version of peer response (#4305) * adding burns and mints to the account transaction (#4307) * changing account transaction to wallet transaction (#4309) * Notify Slack of fixture regeneration failure (#4164) * Fix fixture regeneration failures for diable wallet test (#4310) * Fix fixture regeneration failures for diable wallet test * regnerate * Rahul/ifl 1653 update gettransaction response to use the rpc transaction (#4300) * adding optional serialized field and required signature field * adding serialized to endpoint input * updating getTransaction to use RpcTransaction * passing test * adding full transaction object to burn and mint asset response (#4311) * formatting all rpc objects in the same order (#4313) * formatting all rpc objects in the same order * changing rcp to rpc * removing id * updating export chain stream * standardizing array usage * using [] instead of array * Asset verification field in get balance * rearranging get balances * replacing array with [] * replacing array with [] * Rahul/ifl 1643 update cli to stop using the deprecated fields (#4315) * updating balance command to use asset endpoint * Returning asset id * fetching asset for balance * formatting fixes * using sequence instead of seq * updating wallet note deprecated comment * removing deprecated field usage in wallet transactions and asset utils * fixed deprecated usage in wallet transaction command * reverting eslint to staging * stylistic improvement to use destructing * updating field name * using forloop for more readable code * cleaner lookup logic * reverting to older balances version * explicity type * moving function in file * removing new lines * improving readability * asset lookup helper function * usign asset lookup helper function * using helper in transactinos function * using helper in transactinos function * choice asset name * Resume snapshot downloads if supported (#4308) * Don't use streaming endpoint in status CLI (#4312) * Rahul/ifl 1690 remove dependence on deprecated status field (#4320) * Adding comment * Removing use of deprecated status field * Removing newline * Removing unused variable * removed status from asset wallet command * Adding feerate to mint and burn (#4318) * Handle socket read/write errors * version bump 1.9.0 to 1.10.0 (#4326) * running rust version bump * removing new line --------- Co-authored-by: mat-if <[email protected]> Co-authored-by: Andrea Corbellini <[email protected]> Co-authored-by: Hugh Cunningham <[email protected]> Co-authored-by: lovedret <[email protected]> Co-authored-by: Rohan Jadvani <[email protected]> Co-authored-by: Mat <[email protected]> Co-authored-by: Daniel Cogan <[email protected]> Co-authored-by: ygao76 <[email protected]> Co-authored-by: wica-sufatmawati <[email protected]> Co-authored-by: jowparks <[email protected]> Co-authored-by: Elena Nadolinski <[email protected]> Co-authored-by: Derek Guenther <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fee rate is accepted in send transaction, mint and burn also "send" transactions. Adding the ability to include fee rate for these transaction wallet apis as well.
Testing Plan
Documentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.